/**
 * Magic placeholder 1.0
 * Author: Mac_J@boarsoft.com
 * Need: core.js
 */
(function($){
mac.placeholder = function(self, cfg) {
	if (window.applicationCache)
		return self; //如果支持HTML5则直接返回
	var dk = self.attr('placeholder');
	self.focusout(function(){
		var el = $(this), v = el.val();
		if ((!v || v == dk) && !el.hasClass('empty')) {
			el.addClass('empty');
			el.val(dk);
		}
	}).focusin(function(){
		var el = $(this), v = el.val();
		el.removeClass('empty').val(v==dk?'':v);
	}).val(dk);
	return self;
}
})(jQuery);